<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich" xmlns:c="http://java.sun.com/jsp/jstl/core">
	<ui:composition template="/protected/layout/template.xhtml">
		<ui:define name="head">
			<title><h:outputText value="#{backApp.fullTitle}">- Manutenção de Produtos</h:outputText></title>
		</ui:define>
		<ui:define name="body">
			<rich:panel>
				<f:facet name="header">
					<h3 align="center">
						Manutenção de Produtos
					</h3>
				</f:facet>
				<rich:panel id="recordsServicePanel">
					<h:panelGrid>
						<h:form prependId="false">
							<ui:include src="/store/listAllProducts.xhtml">
								<ui:param name="products" value="#{storeManager.products}" /> 
								<ui:param name="stopText" value="Processando Registro da Tabela" />
								<ui:param name="startText" value="" />
								<ui:param name="modalPanel" value="servicesModalDetails" />
							</ui:include>
						</h:form>
						<!-- 
									################################################### 
									-->
						<rich:modalPanel id="servicesModalDetails" autosized="true">
							<f:facet name="header">
								<h3>
									<h:outputText value="Editar Servicos" />
								</h3>
							</f:facet>
							<f:facet name="controls">
								<span style="cursor: pointer" onclick="javascript:Richfaces.hideModalPanel('serviceDetails')"><b>X</b> </span>
							</f:facet>
							<h:form>
								<ui:include src="#{storeManager.atualSelectionEditPanel}">
									<ui:param name="product" value="#{storeManager.atualSelection}" />
								</ui:include>
								<a4j:region>
									<center>
										<a4j:commandButton value="Salvar" action="#{servicesManager.saveAtualSelection}" reRender="serviceTable"
											oncomplete="javascript:Richfaces.hideModalPanel('serviceDetails')" />
										<a4j:commandButton value="Cancelar" reRender="serviceTable"
											action="#{servicesManager.cancelEditAtualSelection }"
											oncomplete="javascript:Richfaces.hideModalPanel('serviceDetails')" />
									</center>
								</a4j:region>
							</h:form>
						</rich:modalPanel>
					</h:panelGrid>
				</rich:panel>
			</rich:panel>
		</ui:define>
	</ui:composition>
</html>